package com.dylan.springcloud.clientservice.controller;

import com.dylan.springcloud.clientservice.service.UserSerice;
import com.dylan.springcloud.common.util.LogUtil;
import com.dylan.springcloud.common.util.SleepUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Dylan on 2018/10/18.
 */
@RestController
@RequestMapping("/user")
public class TestController {

    @Autowired
    private UserSerice userSerice;

    @RequestMapping("/get/{username}")
    public String get(@PathVariable("username") String username) throws Exception {
        LogUtil.info("请求参数：" + username);
        SleepUtils.seconds(5);
        return userSerice.getUser(username);
    }
}
